package com.neusoft.elm;

import java.util.List;

import com.neusoft.elm.dao.AdminDao;
import com.neusoft.elm.dao.BusinessDao;
import com.neusoft.elm.dao.impl.AdminDaoImpl;
import com.neusoft.elm.dao.impl.BusinessDaoImpl;
import com.neusoft.elm.po.Admin;
import com.neusoft.elm.po.Business;

public class ElmAdmin {

	// 管理员的操作
	public void work() {
	AdminDao adminDao = new AdminDaoImpl();
	Admin admin=adminDao.getAdminByNameByPass("王磊","123");
	if(admin!=null){
		System.out.println("登陆成功");
	}else{
		System.out.println("登录失败");
	}
	
	BusinessDao businessDao = new BusinessDaoImpl();
	List<Business> list = businessDao.listBusiness(null, null);
	
	System.out.println(list.size());
	for(Business b:list){
		System.out.println(b.getBusinessId() + b.getBusinessName()  );
	}	
	
	
	
	}
	public static void main(String[] args) {
		new ElmAdmin().work();
	}
}
